package com.asiainfo.dacp.datastash.orm.dao.state;

import com.asiainfo.dacp.datastash.orm.po.state.DataStashUnitTaskStateLogPo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface DataStashUnitTaskStateLogDao extends JpaRepository<DataStashUnitTaskStateLogPo,String>,JpaSpecificationExecutor<DataStashUnitTaskStateLogPo> {

    @Query("from DataStashUnitTaskStateLogPo p where p.taskProcId=:taskProcId and p.unitCode=:unitCode and p.batchNo=:batchNo")
    DataStashUnitTaskStateLogPo findTaskState(@Param("taskProcId") String taskProcId, @Param("unitCode") String unitCode, @Param("batchNo") String batchNo);
}
